package com.iworkh.spring.data.jdbc;

import com.iworkh.spring.data.jdbc.dao.BookDao;
import com.iworkh.spring.data.jdbc.domain.entity.Book;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 入口类
 *
 * @author: iworkh-沐雨云楼
 * @date: 2019-12-19
 */
public class App {

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-data.xml");

        BookDao bookDao = (BookDao) context.getBean("bookDao");
        bookDao.save(Book.builder().id("1").author("沐雨云楼").build());
    }
}
